# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-resizeimage
pkgver=1.1.20
pkgrel=1
pkgdesc="A small python package to easily resize images"
url="https://github.com/VingtCinq/python-resize-image"
arch="noarch"
license="MIT"
# tests are broken due to missing file(s) in distribution tarball on PyPI
options="!check"
depends="py3-pillow py3-requests"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="py3-resizeimage-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/p/python-resize-image/python-resize-image-$pkgver.tar.gz"
builddir="$srcdir/python-resize-image-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b20bdafeb764b8169cd13056c562a3ea6fd3c4a1a987d81c7c0355e5b093f55a205c861e6a52eecb40d988a7c18bf01653b4edbd1adc4fa5207c21bd4baa9d61  py3-resizeimage-1.1.20.tar.gz
"
